Handle 200 OK errors in PutObject (multipart) in S3 CRT client#7084
Merged
Conversation
alextwoods
commented
Jun 26, 2026
|
|
||
| @BeforeAll | ||
| public static void setUpBeforeAll() { | ||
| System.setProperty("aws.crt.debugnative", "true"); |
Contributor
Author
There was a problem hiding this comment.
zoewangg
approved these changes
Jun 26, 2026
Fred1155
approved these changes
Jun 26, 2026
|
This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Handle 200 OK errors in PutObject (multipart) in S3 CRT client
Motivation and Context
Fixes: #7068
The CRT client already detects 200ok errors during MPU in PutObject, however, they are not correctly handled in our Java code.
The reason the normal handling of 200OK errors does not work for this case is that the 200OK error handling is normally only applied for non-streaming operations. PutObject is a streaming operation, but under the hood, the CRT may do a MPU, and complete multipart upload is not streaming and may respond with a 200 OK error.
Modifications
Wrap the SDK response object in a new
ErrorFlaggedSdkHttpResponsewhich returns false forisSuccessful, causing the SDK's normal error parsing to be used.Note, earlier PR #7071 does correctly raise an exception, but does not parse the code/message from the body. To avoid brining in xml parsing to the CRT handler, this PR wraps the sdk response object and relies on the existing error unmarshalling pipeline.
Testing
New and existing unit tests + ran repro from #7068 to confirm.
Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License